package com.breaktime1903.stinky_eggs;

import net.minecraft.sounds.*;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
import net.minecraft.resources.ResourceLocation;

public class StinkyEggsSoundEvents {
    public static final DeferredRegister<SoundEvent> SOUNDS = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS,StinkyEggsMod.MODID);
    public static final RegistryObject<SoundEvent> ON_SHOOT = registerSoundEvent("on_shoot");
    public static final RegistryObject<SoundEvent> ON_EXPLOSION = registerSoundEvent("on_explosion");
    public static final RegistryObject<SoundEvent> ON_FAILED_EXPLOSION = registerSoundEvent("on_failed_explosion");
    public static final RegistryObject<SoundEvent> ON_HIT_ENTITY = registerSoundEvent("on_hit_entity");

    public static RegistryObject<SoundEvent> registerSoundEvent(String name)
    {
        return SOUNDS.register(name, () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(StinkyEggsMod.MODID, name)));
    }
    public static void register(IEventBus eventBus)
    {
        SOUNDS.register(eventBus);
    }
}
